//https://leetcode-cn.com/problems/palindrome-number/submissions/

//先获取每一位哦存在数组中 然后再按位取出 
#include<math.h>
bool isPalindrome(int x)
{
    if(x < 0)
    {
        return false;
    }
    //用int的数组就可以 ,做题时脑抽写的char
    char str[20] = { 0 };
    int i = 0;
    int bit = 0;
    int tmp = abs(x);
    while(tmp)
    {
        bit = tmp % 10;
        str[i++] = bit + '0';
        tmp /= 10;
    }
    //str[i] = '\0';

    int ret = 0;
    long jin = 1;
    while(i--)
    {

        tmp = (str[i] - '0') * jin;
        jin *= 10;
        ret += tmp;
    }
    if(ret == (abs(x)))
    {
        return true;
    }
    return false;
}